export const getItem = (val: string) => {
  const result = localStorage.getItem(val)
  let tip
  if (typeof result === 'string') {
    tip = JSON.parse(result)
  }
  return tip
}
export const setItem = <T>(name: string, val: T): void => {
  const item = JSON.stringify(val)
  localStorage.setItem(name, item)
}
export const removeItem = (val: string): void => {
  localStorage.removeItem(val)
}
